// 实时资讯
import { defineComponent, reactive, ref } from "vue";
import { dxget, qurl } from "../../util/index";
export default defineComponent({
  props: {
    Art_Code: {
      type: [],
    },
  },
  emits: ["getCode"],
  setup(props, context) {
    let zxdata = ref({
      post_content: "",
      post_title: "",
    });
    let loading = ref(true);
    const initData = async () => {
      const { data }: any = await dxget("dc/NewsArticleBriefInfo", {
        postid: props.Art_Code,
      });
      loading.value = true;
      zxdata.value = data;
      context.emit("getCode", data.code);
    };
    initData();
    return () => (
      <>
        <n-card title="实时资讯">
          <div>
            <p>{zxdata.value.post_title}</p>
            <div class="post-content" v-html={zxdata.value.post_content}></div>
          </div>
          {/* <n-space vertical>
            <n-skeleton height="400px" width="100%" />
          </n-space> */}
        </n-card>
      </>
    );
  },
});
